package AST;

public class Atom {
	private Listmaker listmaker;
	private SPyName name;
	private SPyNumber number;
	private SPyString string;

	public Atom(Listmaker listmaker, SPyName name, SPyNumber number,
			SPyString string) {
		print();
		this.listmaker = listmaker;
		this.name = name;
		this.number = number;
		this.string = string;
	}

	public Atom() {
		print();
	}

	public Listmaker getListmaker() {
		return listmaker;
	}

	public void setListmaker(Listmaker listmaker) {
		this.listmaker = listmaker;
	}

	public SPyName getName() {
		return name;
	}

	public void setName(SPyName name) {
		this.name = name;
	}

	public SPyNumber getNumber() {
		return number;
	}

	public void setNumber(SPyNumber number) {
		this.number = number;
	}

	public SPyString getString() {
		return string;
	}

	public void setString(SPyString string) {
		this.string = string;
	}

	public void print() {
		System.out.println("Atom");
	}

	public void genC(PW pw) {
		if (this.name != null)
			name.genC(pw);
		else if (this.number != null)
			number.genC(pw);
		else if (this.string != null)
			string.genC(pw);
		else if (this.listmaker != null) {
			pw.print("( ");
			this.listmaker.genC(pw);
			pw.print(" )");
		}
	}

}
